package com.example.yls.demoa;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
public class MyDataBaseHelper extends SQLiteOpenHelper {
    private static final String DATABASE_NAME = "Notebook.db";
    private static final int DATABASE_VERSION = 1;

    private static final String creat_student = "CREATE TABLE note( " +
            "_id INTEGER PRIMARY KEY autoincrement," +
            "title TEXT, " +
            "content TEXT, " +
            "img BLOB, " +
            "audio BLOB " +
            "videoPath TEXT"+
            "append BLOB"+
            "location TEXT"+
            "createTime DATA"+
            "updateTime DATA"+
            ");";
//    private static final String insert_student1 = "insert into student(no,name,birth,phone) values('201801','张力','2000-09-01','13800138000')";
    public MyDataBaseHelper(Context context) {
        super(context, DATABASE_NAME, null, DATABASE_VERSION);
    }
    @Override
    public void onCreate(SQLiteDatabase db) {
        db.execSQL(creat_student);
//        db.execSQL(insert_student1);
    }
    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        // TODO Auto-generated method stub
        db.execSQL("drop table if exists note");
        onCreate(db);
    }
}
